package cn.seaboot.admin.other.web;

import cn.seaboot.admin.other.bean.SystemProperty;
import cn.seaboot.admin.other.manager.RuntimePropertiesService;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * 系统环境配置
 *
 * @author Mr.css
 * @version 2020-10-09 17:55
 */
@Controller
@RequestMapping("sys/env")
public class EnvironmentCtrl {

    @Resource
    private RuntimePropertiesService runtimePropertiesService;


    /**
     * 获取系统参数
     *
     * @return list
     */
    @ResponseBody
    @Operation(description = "获取系统参数")
    @RequestMapping(value = "properties", method = RequestMethod.GET)
    public List<SystemProperty> saveInfo() {
        return runtimePropertiesService.getAll();
    }
}
